/*
package com.wqm.step.controller;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.junit.Test;

import com.wqm.step.common.utils.HibernateUtils;
import com.wqm.step.pojo.Customer;

public class SQLTest {
	
	//测试本地sql命名查询
	@Test
	public void test2(){
		Session session = HibernateUtils.openSession();
		session.beginTransaction();

		Query query = session.getNamedQuery("findCustomer");
		List list = query.list();
		System.out.println(list);
		session.getTransaction().commit();
		session.close();
	}

	// 测试执行本地sql
	@Test
	public void test1() {
		Session session = HibernateUtils.openSession();
		session.beginTransaction();
		// 执行本地sql
		SQLQuery sqlQuery = session.createSQLQuery("select * from t_customer");
		// List<Object[]> list = sqlQuery.list();
		sqlQuery.addEntity(Customer.class); // 将查询结果绑定到指定对象
		// sqlQuery.setParameter(position, val) //给参数赋值
		List list = sqlQuery.list();
		System.out.println(list);
		session.getTransaction().commit();
		session.close();
	}
}
*/
